<?php

class HcardBlockController extends BlockController {

	protected $btDescription = "hCard Block";
	protected $btName = "hCard";
	protected $btTable = 'bthCard';
	protected $btInterfaceWidth = "600";
	protected $btInterfaceHeight = "530";

	public function getJavaScriptStrings() {
		return array(
			"familyName"	=> t("Please input family name. "),
			"givenName"	=> t("Please input  given name."),
			"url"					=> t("Please input  website url."),
			"email"			=> t("Please input  email address."),
			"emailValid"  => t("The mistake is found in the format of the email address. "),
			"urlValid"		=> t("The mistake is found in the format of the url. ")
		);
	}

	public function getTelphoneTypes() {
		return array(
			"voice" => t("voice"),	"home" => t("home"),
			"work" => t("work"),	"cell" => t("cell"),
			"pager" => t("pager"), "car" => t("car"),
			"msg" => t("msg"), "fax" => t("fax"),
			"video" => t("video"), "bbs" => t("bbs"),
			"modem" => t("modem"), "isdn" => t("isdn"),
			"pcs" => t("pcs"), "pref" => t("pref")
		);
	}

	public function getAddressTypes() {
		return array(
			"home"	=> t("home"),	 "work"	=> t("work"),
			"postal"	=> t("postal"),	"parcel"	=> t("parcel"),
			"dom"		=> t("dom"),	"intl"		=> t("intl"),
			"pref"		=> t("pref")
		);
	}

	public function getAddressTypeName($key) {
		$types = $this->getAddressTypes();
		return (in_array($key, $types)) ? $types[$key] : "";
	}

	public function getTelphoneTypeName($key) {
		$types = $this->getTelphoneTypes();
		return (in_array($key, $types)) ? $types[$key] : "";
	}

	public function save($p) {
		parent::save($p);
	}

}
	
?>